package com.timber.util;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class PaymentBean extends SLDataObjectAdaptor implements Serializable  {
	
	String customerID ;          	
	String invoiceNumber;           
	String customerName;          	
	double openAmount;           	
	double paymentAmount;  
	double totalPaidAmount;
	String paymentDate;           	
	String companyName;				

	
	String CUSTOMER_ID    		 ="CustomerID"			;
	String INOVICENUMBER    	 ="InvoiceNumber"		;
	String	CUSTOMER_NAME		 ="CustomerName"            ;   
	String	OPEN_AMOUNT		 	 ="OpenAmount"        ;	
	String	PAYMENT_AMOUNT	 	 = "PaymentAmount"		;	
	String	PAYMENT_DATE	 	 ="PaymentDate"  		;	
	String	COMPANY_NAME     	 ="CompanyName"			;
	
	public boolean load(ResultSet rs) throws SQLException
	{
		invoiceNumber=rs.getString(INOVICENUMBER);     
		openAmount	=rs.getDouble(OPEN_AMOUNT);
		paymentAmount	=rs.getDouble(PAYMENT_AMOUNT);
		paymentDate =rs.getDate(PAYMENT_DATE)+"";
		customerName =rs.getString(CUSTOMER_NAME);
		companyName=rs.getString(COMPANY_NAME);
		return true;
	}
	
	public PaymentBean()
	
	{
	}
	
	
	
	public PaymentBean( PaymentBean rawItem )
	
	{
		invoiceNumber=rawItem.getInvoiceNumber();     
		openAmount	=rawItem.getOpenAmount();
		paymentAmount	=rawItem.getPaymentAmount();
		paymentDate =rawItem.getPaymentDate()+"";
		customerName =rawItem.getCustomerName();
		companyName=rawItem.getCompanyName();
		
	}
	/**
	 * @return Returns the companyName.
	 */
	public String getCompanyName() {
		return companyName;
	}
	/**
	 * @param companyName The companyName to set.
	 */
	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	/**
	 * @return Returns the customerID.
	 */
	public String getCustomerID() {
		return customerID;
	}
	/**
	 * @param customerID The customerID to set.
	 */
	public void setCustomerID(String customerID) {
		this.customerID = customerID;
	}
	/**
	 * @return Returns the customerName.
	 */
	public String getCustomerName() {
		return customerName;
	}
	/**
	 * @param customerName The customerName to set.
	 */
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
	/**
	 * @return Returns the invoiceNumber.
	 */
	public String getInvoiceNumber() {
		return invoiceNumber;
	}
	/**
	 * @param invoiceNumber The invoiceNumber to set.
	 */
	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}
	/**
	 * @return Returns the openAmount.
	 */
	public double getOpenAmount() {
		return openAmount;
	}
	/**
	 * @param openAmount The openAmount to set.
	 */
	public void setOpenAmount(double openAmount) {
		this.openAmount = openAmount;
	}
	/**
	 * @return Returns the paymentAmount.
	 */
	public double getPaymentAmount() {
		return paymentAmount;
	}
	/**
	 * @param paymentAmount The paymentAmount to set.
	 */
	public void setPaymentAmount(double paymentAmount) {
		this.paymentAmount = paymentAmount;
	}
	/**
	 * @return Returns the paymentDate.
	 */
	public String getPaymentDate() {
		return paymentDate;
	}
	/**
	 * @param paymentDate The paymentDate to set.
	 */
	public void setPaymentDate(String paymentDate) {
		this.paymentDate = paymentDate;
	}
	/**
	 * @return Returns the totalPaidAmount.
	 */
	public double getTotalPaidAmount() {
		return totalPaidAmount;
	}
	/**
	 * @param totalPaidAmount The totalPaidAmount to set.
	 */
	public void setTotalPaidAmount(double totalPaidAmount) {
		this.totalPaidAmount = totalPaidAmount;
	}
}
